//
//  ButtonCollectionCell.m
//  WhereToTravel
//
//  Created by dlios on 15/10/16.
//  Copyright © 2015年 zhoushengmin. All rights reserved.
//

#import "ButtonCollectionCell.h"
#define W self.contentView.frame.size.width/50
#define H self.contentView.frame.size.height/80

@implementation ButtonCollectionCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    [super createView];
    self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(-8*W, H*3, W*40, H*40)];
    [self.contentView addSubview:self.imageView];
    
    self.label.font = [UIFont boldSystemFontOfSize:13];
    self.label.frame = CGRectMake(0, H*50, W*50, H*30);
    
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(-8 * W);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.8);
        make.top.equalTo(self.contentView.mas_top).offset(3 * H);
        make.height.equalTo(self.contentView.mas_height).multipliedBy(0.5);
    }];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView);
        make.width.equalTo(self.contentView.mas_width);
        make.top.equalTo(self.imageView.mas_bottom).offset(10 * H);
        make.height.equalTo(self.contentView.mas_height).multipliedBy(0.37);
    }];
}




@end
